package com.wangshupo.app.geekpark.control;

import com.wangshupo.app.geekpark.model.Author;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TestController {

    @GetMapping("/hello")
    public List test(){
        List<Author> authorList = new ArrayList<>();

        Author author = new Author();
        author.setName("wangshupo");

        authorList.add(author);
        author.setName("汪书坡");  //对引用内容的修改

        return authorList;    //  "name": "汪书坡",
    }

}
